package com.lanou.moving.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import com.lanou.moving.fragment.FragmentFactory;
import java.util.List;

/**
 * Created by dllo on 15/10/20.
 */
public class FragmentAdapter extends FragmentPagerAdapter {
    private List<Fragment> datas;
    private String [] titles = {"我的", "推荐", "发现"};

    public FragmentAdapter(FragmentManager fm) {
        super(fm);

    }


    @Override
    public Fragment getItem(int position) {
        return FragmentFactory.createFragment(position);
    }

    @Override
    public int getCount() {
        return titles.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
